package chap4;
import java.util.Random;
public class exercise1 {
        public static void main(String []args)
        {
            Random generator = new Random();
            int num1;
            num1 = generator.nextInt(20)-10;
            Integer obj1;
            obj1 = num1;

            System.out.println("随机数为 :"+obj1);
            System.out.println("二进制为 :"+Integer.toBinaryString(obj1));
            System.out.println("十六进制 :"+Integer.toHexString(obj1));
        }
    }


